package com.hotel.project.usercenter.controller;

import com.hotel.project.usercenter.domain.Cash;
import com.hotel.project.usercenter.service.CashService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author William
 * @create 2022-04-14 9:45
 */
@RestController
@RequestMapping("/cash")
public class CashController {

    @Autowired
    private CashService cashService;

    @ApiOperation(value = "查询", notes = "根据用户id查询零钱")
    @GetMapping("/select-cash-by-userid/{id}")
    public List<Cash> selectCashByUserId(@PathVariable("id") Long UserId){
        return cashService.findByUserId(UserId);
    }
}
